<template>
  <view class="my-search-container" :style="{'background-color': bgcolor}">
    <view class="my-search-box" :style="{'border-radius': radius + 'px'}">
      <icon type="search" size="17"></icon>
      <text class="placeholder">搜索</text>
    </view>

  </view>
</template>

<script>
  export default {
    name: "my-search",
    data() {
      return {
        
      };
    },
    props: {
      // 背景颜色
      bgcolor: {
        type: String,
        default: '#C00000'
      },
      // 圆角尺寸
      radius: {
        type: Number,
        // 单位是 px
        default: 18
      }
    }
  }
</script>

<style lang="scss">
  .my-search-container {
    height: 50px;
    // 移除背景颜色，改由 props 属性控制
    // background-color: #C00000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 10px;

    .my-search-box {
      height: 36px;
      width: 100%;
      background-color: #fff;
      // 移除圆角尺寸，改由 props 属性控制
      // border-radius: 18px;
      display: flex;
      justify-content: center;
      align-items: center;
      
      .placeholder{
        font-size: 15px ;
        margin-left: 5px;
      }
    }
  }
</style>
